<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.checkboxes.min.js"></script>
<script language="javascript" src="js/tableRowCheckboxToggle.js"></script>
<script>
$(document).ready(function(){
		//點擊事件切換 全選取消狀態
		$("#selectall").click( function (){ $("#grouplist").toggleCheckboxes(); });
	});
</script>
<title>商家列表</title>
</head>

<body>
<div id="man_zone">

  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      	<td>
		    <input type="button" onclick="grouplist.submit();" name="Submit" value="刪除選定" />
		    <input type="button" onclick="location.href='groupbond_add.php?gid=<?php echo $gid?>'" name="Submit2" value="添加團購卷" />
		    <input type="button" onclick="location.href='groupbond_adds.php?gid=<?php echo $gid?>'" name="Submit22" value="批量添加團購卷" />   	  
		</td>
      <td align="right">
      	<form id="seach" name="seach" method="get" action="">
         &nbsp;團購ID：
            <input name="gid" type="text" id="gid" size="15" />
      &nbsp;會員ID：
      <input name="uid" type="text" id="uid" size="15" />
      &nbsp;序列號：
      <input name="sn" type="text" id="sn" size="15" />
      &nbsp;訂單號：
      <input name="order_sn" type="text" id="order_sn" size="15" />
      &nbsp;
      <input type="submit" name="Submit3" value="搜索" />
      </form>
      </td>
    </tr>
  </table>
<form method="post" action="?action=dels" name="grouplist" id="grouplist">
  <table width="99%" align="center"  border="0" cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <th width="2%"><label>
        <input type="checkbox" name="checkbox" value="checkbox" id="selectall" />
      </label></th>
      <th width="4%">編號</th>
      <th width="7%">團購編號</th>
      <th width="20%">團購名稱</th>
      <th width="14%">序列號</th>
      <th width="15%">過期時間</th>
      <th width="13%">使用時間</th>
      <th width="11%">訂單號</th>
      <th width="6%">會員ID</th>
      <th width="8%">操作</th>
    </tr>
	<?php if(is_array($dataarray)){foreach($dataarray as $value){?>
    <tr class="odd_row">
      <td align="center"><input type="checkbox" name="delids[]" value="<?php echo $value['bid']?>" /></td>
      <td><?php echo $value['bid']?></td>
      <td><?php echo $value['gid']?>&nbsp;</td>
      <td><?php echo $value['gtitle']?></td>
      <td><?php echo $value['sn']?>&nbsp;&nbsp;</td>
      <td><?php echo date("Y-m-d H:i",$value['endtime'])?></td>
      <td><?php if($value['usetime']!=0)echo date("Y-m-d H:i",$value['usetime'])?>&nbsp;</td>
      <td><?php echo $value['order_sn']?></td>
      <td><?php echo $value['uid']?></td>
      <td>
      <a href="groupbond_list.php?action=edit&amp;bid=<?php echo $value['bid']?>">編輯</a><br />
      <a href="groupbond_list.php?action=printbond&amp;bid=<?php echo $value['bid']?>" target="_blank">列印團購卷</a><br />
      <a href="groupbond_list.php?action=printbond&amp;bid=<?php echo $value['bid']?>&amp;type=word" target="_blank">下載Word檔</a><br />
      <a href="javascript:if(confirm('確實要退款嗎?'))location='groupbond_list.php?action=refuse&bid=<?php echo $value['bid']?>&state=4'">退款</a><br />
      <a href="javascript:if(confirm('確實要刪除嗎?'))location='groupbond_list.php?action=del&bid=<?php echo $value['bid']?>'">刪除</a></td>
    </tr>
	<?php }}else{?>
	<tr><td colspan=10>暫無數據..............</td></tr>
	<?php };?>
  </table>
  

  <div style="width:99%;margin:0px auto;">

  
    <?php echo multi($total,$pagesize,$page,"");?>
  </div>
  </form>
</div>
</body>
</html>
